<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/24
 * Time: 16:36
 */


/**
 * 生成随机字符串
 * @param $needLen 所需长度
 * @return string
 */
function great_rand($needLen){
    $str = '1234567890abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
    $t1='';
    $len=strlen($str);
    for($i = 0; $i < $needLen; $i ++) {
        $j = rand ( 0, $len-1 );
        $t1 .= $str [$j];
    }
    return $t1;
}